/* ************************************************************************** */
/* Example of a syndication feed reader using the Project Rome API with */
/* BSF4ooRexx */
/* current version of Rome: rome1.0.jar https://rome.dev.java.net/ */
/* You need to implement this API plus the JDOM API */
/* jdom.jar , you can find this at https://jdom.org/ */
/* */
/* This example shows how to set the type of a feed */
/* created by Martin Stoppacher date: 26.12.2009 */
/* license:ÊÊÊÊLGPL 3.0ÊÊÊÊÊÊÊused versions: Java 1.6, ooRexx 4.0, Bsf4ooRexx */
/* (Lesser Gnu Public License version 3.0), */
/* cf. <http://www.gnu.org/licenses/lgpl.html> */
/* ************************************************************************** */
say hello this reads a syndfeed
say please type in the url
url="http://rss.orf.at/fm4.xml"
feedUrl=.bsf~new("java.net.URL", url)
say connecting__ || feedUrl~getAuthority()
--call Syssleep 1
sl = BSF("sleep",3) /* BSF Subfunction referencing to the Java Bean */
input=.bsf~new("com.sun.syndication.io.SyndFeedInput")
xmlr=.bsf~new("com.sun.syndication.io.XmlReader", feedUrl)
feed=input~build(xmlr)
feed~setFeedType("rss_1.0") /* This line allows to set the type of the feed */
/* the default formats in ROME are: rss_0.90, rss_0.91, rss_0.92, */
/* rss_0.93, rss_0.94, rss_1.0 rss_2.0 or atom_0.3 */
say feed~getFeedType() /* This line retrieves the current type */
feed~setFeedType("rss_2.0")
say feed~getFeedType()
feed~setFeedType("atom_1.0")
say feed~getFeedType()
::requires BSF.cls /* get the Java support */